<template>
  <div class="box-all w-card">
    <el-tabs v-model="activeName" @tab-change="tabChange">
      <!-- <el-tab-pane :disabled="loading" label="类型管理" :name="1">
        <div :style="{'height':tableHeight+'px'}" class="tab-box">
          <div class="tab-box-title">
            <span>商品类型列表</span>
            <el-button style="margin-left:auto;" type="primary" icon="Plus" @click="editType(null)">新增类型</el-button>
          </div>
          <div class="search-box">
            <div>
              <span>类型名称:</span>
              <el-input v-model="searchForm.typeName" clearable placeholder="请输入类型名称" />
            </div>
            <div>
              <span>类型状态:</span>
              <el-select style="width:100%" v-model="searchForm.typeStatus" clearable>
                <el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value" />
              </el-select>
            </div>
            <el-button type="primary" @click="searchHandle">搜索</el-button>
          </div>
          <div class="table-box">
            <el-table :height="tableHeight-150" :header-cell-style="{background:'#d6dee5',color:'#000000',fontSize:'14px'}"
              :cell-style="{fontSize:'14px',color:'#7b7b7d'}" :data="tableData" stripe>
              <el-table-column type="index" width="55" label="序号" align="center" />
              <el-table-column prop="typeName" label="类型名称" align="center">
                <template v-slot="scope">
                  {{ scope.row.typeName || '' }}
                </template>
              </el-table-column>
              <el-table-column prop="typeStatus" label="状态" align="center">
                <template v-slot="scope">
                  <span :class="'state'+scope.row.typeStatus"></span>
                  {{ scope.row.typeStatus == 0 ? '下架' : '销售中' }}
                </template>
              </el-table-column>
              <el-table-column prop="createTime" label="上架时间" align="center">
                <template v-slot="scope">
                  {{ scope.row.createTime ? getDateTime(scope.row.createTime)[6] : '' }}
                </template>
              </el-table-column>
              <el-table-column prop="createUserName" label="操作人" align="center">
                <template v-slot="scope">
                  {{ scope.row.createUserName || '' }}
                </template>
              </el-table-column>
              <el-table-column prop="Operations" label="操作" align="center" width="160">
                <template v-slot="scope">
                  <div class="table-handle-box">
                    <el-link style="font-size:14px" type="primary" @click="editType(scope.row)">编辑</el-link>
                    <el-link v-if="scope.row.typeStatus == 0" style="font-size:14px" type="primary"
                      @click="lookHanlde(1,scope.row)">上架</el-link>
                    <el-link v-if="scope.row.typeStatus == 1" style="font-size:14px" type="danger"
                      @click="lookHanlde(2,scope.row)">下架</el-link>
                    <el-link style="font-size:14px" type="danger" @click="lookHanlde(3,scope.row)">删除</el-link>
                  </div>
                </template>
              </el-table-column>
            </el-table>
            <div class="table-footer">
              <el-pagination v-model:currentPage="page" v-model:page-size="size" :page-sizes="[10, 20, 50, 100]" small
                :background="true" layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handleSizeChange"
                @current-change="handleCurrentChange" />
            </div>
          </div>
        </div>
      </el-tab-pane> -->
      <el-tab-pane :disabled="loading" label="分类管理" :name="2">
        <div :style="{'height':tableHeight+'px'}" class="tab-box">
          <div class="tab-box-title">
            <span>商品分类列表</span>
            <el-button style="margin-left:auto;" type="primary" icon="Plus" @click="editSimple(null)">新增分类</el-button>
          </div>
          <div class="search-box">
            <div>
              <span>类型:</span>
              <el-select style="width:100%" v-model="searchForm.typeId" clearable>
                <el-option v-for="item in typeOptions" :key="item.typeId" :label="item.typeName" :value="item.typeId" />
              </el-select>
            </div>
            <div>
              <span>分类名称:</span>
              <el-input v-model="searchForm.categoryName" clearable placeholder="请输入分类名称" />
            </div>
            <div>
              <span>分类状态:</span>
              <el-select style="width:100%" v-model="searchForm.categoryStatus" clearable>
                <el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value" />
              </el-select>
            </div>
            <el-button type="primary" @click="searchHandle">搜索</el-button>
          </div>
          <div class="table-box">
            <el-table :height="tableHeight-150" :header-cell-style="{background:'#d6dee5',color:'#000000',fontSize:'14px'}"
              :cell-style="{fontSize:'14px',color:'#7b7b7d'}" :data="tableData" stripe @sort-change="tableSortChange">
              <el-table-column type="index" width="55" label="序号" align="center" />
              <el-table-column prop="typeName" label="商品类型" align="center">
                <template v-slot="scope">
                  {{ scope.row.typeName || '' }}
                </template>
              </el-table-column>
              <el-table-column prop="categoryName" label="分类名称" align="center">
                <template v-slot="scope">
                  {{ scope.row.categoryName || '' }}
                </template>
              </el-table-column>
              <el-table-column prop="showPower" label="权重" align="center" sortable="custom">
                <template v-slot="scope">
                  {{ scope.row.showPower || '' }}
                </template>
              </el-table-column>
              <el-table-column prop="finalStatus" label="状态" align="center">
                <template v-slot="scope">
                  <span :class="'state'+scope.row.finalStatus"></span>
                  {{ scope.row.finalStatus == 0 ? '下架' : '销售中' }}
                </template>
              </el-table-column>
              <el-table-column prop="createTime" label="上架时间" align="center" sortable="custom">
                <template v-slot="scope">
                  {{ scope.row.createTime ? getDateTime(scope.row.createTime)[6] : '' }}
                </template>
              </el-table-column>
              <el-table-column prop="createUserName" label="操作人" align="center">
                <template v-slot="scope">
                  {{ scope.row.createUserName || '' }}
                </template>
              </el-table-column>
              <el-table-column prop="Operations" label="操作" align="center" width="160">
                <template v-slot="scope">
                  <div class="table-handle-box">
                    <el-link style="font-size:14px" type="primary" @click="editSimple(scope.row)">编辑</el-link>
                    <el-link v-if="scope.row.finalStatus == 0" style="font-size:14px" type="primary"
                      @click="lookHanlde2(1,scope.row)">上架</el-link>
                    <el-link v-if="scope.row.finalStatus == 1" style="font-size:14px" type="danger"
                      @click="lookHanlde2(2,scope.row)">下架</el-link>
                    <el-link style="font-size:14px" type="danger" @click="lookHanlde2(3,scope.row)">删除</el-link>
                  </div>
                </template>
              </el-table-column>
            </el-table>
            <div class="table-footer">
              <el-pagination v-model:currentPage="page" v-model:page-size="size" :page-sizes="[10, 20, 50, 100]" small
                :background="true" layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handleSizeChange"
                @current-change="handleCurrentChange" />
            </div>
          </div>
        </div>
      </el-tab-pane>
      <el-tab-pane :disabled="loading" label="品牌管理" :name="3">
        <div :style="{'height':tableHeight+'px'}" class="tab-box">
          <div class="tab-box-title">
            <span>商品品牌列表</span>
            <el-button style="margin-left:auto;" type="primary" icon="Plus" @click="editBrand(null)">新增品牌</el-button>
          </div>
          <div class="search-box">
            <div>
              <span>品牌名称:</span>
              <el-input v-model="searchForm.brandName" clearable placeholder="请输入品牌名称" />
            </div>
            <div>
              <span>类型:</span>
              <el-select style="width:100%" v-model="searchForm.typeId" clearable @change="typeChange">
                <el-option v-for="item in typeOptions" :key="item.typeId" :label="item.typeName" :value="item.typeId" />
              </el-select>
            </div>
            <div>
              <span>分类:</span>
              <el-select style="width:100%" v-model="searchForm.categoryId" clearable no-data-text="请先选择类型">
                <el-option v-for="item in simpleOptions" :key="item.categoryId" :label="item.categoryName"
                  :value="item.categoryId" />
              </el-select>
            </div>
          </div>
          <div class="search-box">
            <div>
              <span>品牌状态:</span>
              <el-select style="width:100%" v-model="searchForm.brandStatus" clearable>
                <el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value" />
              </el-select>
            </div>
            <!-- <div>
              <span>生产方式:</span>
              <el-select style="width:100%" v-model="searchForm.produceMode" clearable>
                <el-option v-for="item in scOptions" :key="item.value" :label="item.label" :value="item.value" />
              </el-select>
            </div> -->
            <el-button type="primary" @click="searchHandle">搜索</el-button>
            <el-button @click="restHandle" style="margin-left:0;">重置</el-button>
          </div>
          <div class="table-box">
            <el-table :height="tableHeight-210" :header-cell-style="{background:'#d6dee5',color:'#000000',fontSize:'14px'}"
              :cell-style="{fontSize:'14px',color:'#7b7b7d'}" :data="tableData" stripe @selection-change="handleSelectionChange"
              @sort-change="tableSortChange">
              <el-table-column type="selection" width="55" />
              <el-table-column type="index" width="55" label="序号" align="center" />
              <el-table-column prop="categoryName" label="缩略图" align="center">
                <template v-slot="scope">
                  <img :src="scope.row.logoImg" style="width:60px;" alt="">
                </template>
              </el-table-column>
              <el-table-column prop="typeName" label="类型" align="center">
                <template v-slot="scope">
                  {{ scope.row.typeName || '' }}
                </template>
              </el-table-column>
              <el-table-column prop="categoryName" label="分类" align="center">
                <template v-slot="scope">
                  {{ scope.row.categoryName || '' }}
                </template>
              </el-table-column>
              <el-table-column prop="brandName" label="品牌名称" align="center">
                <template v-slot="scope">
                  {{ scope.row.brandName || '' }}
                </template>
              </el-table-column>
              <el-table-column prop="tag" label="标签" align="center">
                <template v-slot="scope">
                  {{ scope.row.tag || '' }}
                </template>
              </el-table-column>
              <el-table-column prop="showPower" label="权重" align="center" sortable="custom">
                <template v-slot="scope">
                  {{ scope.row.showPower || '' }}
                </template>
              </el-table-column>
              <!-- <el-table-column prop="produceMode" label="生产方式" align="center">
                <template v-slot="scope">
                  {{ scope.row.produceMode == 1 ? '自动生产' : scope.row.produceMode == 2 ? '手动生产' : '' }}
                </template>
              </el-table-column> -->
              <el-table-column prop="finalStatus" label="状态" align="center">
                <template v-slot="scope">
                  <span :class="'state'+scope.row.finalStatus"></span>
                  {{ scope.row.finalStatus == 0 ? '下架' : '销售中' }}
                </template>
              </el-table-column>
              <el-table-column prop="createTime" label="上架时间" align="center" width="170" sortable="custom">
                <template v-slot="scope">
                  {{ scope.row.createTime ? getDateTime(scope.row.createTime)[6] : '' }}
                </template>
              </el-table-column>
              <el-table-column prop="createUserName" label="操作人" align="center">
                <template v-slot="scope">
                  {{ scope.row.createUserName || '' }}
                </template>
              </el-table-column>
              <el-table-column prop="Operations" label="操作" align="center" width="160">
                <template v-slot="scope">
                  <div class="table-handle-box">
                    <el-link style="font-size:14px" type="primary" @click="editBrand(scope.row)">编辑</el-link>
                    <el-link v-if="scope.row.finalStatus == 0" style="font-size:14px" type="primary"
                      @click="lookHanlde3(1,scope.row)">上架</el-link>
                    <el-link v-if="scope.row.finalStatus == 1" style="font-size:14px" type="danger"
                      @click="lookHanlde3(2,scope.row)">下架</el-link>
                    <el-link style="font-size:14px" type="danger" @click="lookHanlde3(3,scope.row)">删除</el-link>
                  </div>
                </template>
              </el-table-column>
            </el-table>
            <div class="table-footer2">
              <div>
                <el-button :disabled="chooseList.length == 0" type="warning" plain @click="handleClick(4)">批量上架</el-button>
                <el-button :disabled="chooseList.length == 0" plain @click="handleClick(5)">批量下架</el-button>
                <el-button :disabled="chooseList.length == 0" plain @click="handleClick(6)">批量删除</el-button>
              </div>
              <el-pagination v-model:currentPage="page" v-model:page-size="size" :page-sizes="[10, 20, 50, 100]" small
                :background="true" layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handleSizeChange"
                @current-change="handleCurrentChange" />
            </div>
          </div>
        </div>
      </el-tab-pane>
    </el-tabs>
  </div>
  <edit-dialog ref="editDialogRef" @dialogClose="getTableData" />
  <edit-simple ref="editSimpleRef" @dialogClose="getTableData" />
  <edit-brand ref="editBrandRef" @dialogClose="getTableData" />
  <confirm-pass ref="confirmPassRef" @verification="verification" />
</template>

<script>
import { onMounted, reactive, ref, toRefs } from 'vue'
import { getWindowWidthAndHeight, warningDeal, getDateTime } from '@/utils/utils'
import editDialog from './components/editDialog.vue'
import editSimple from './components/editSimple.vue'
import editBrand from './components/editBrand.vue'
import confirmPass from '@/components/confirmPass.vue'
import api from './api'
export default {
  components: {
    editDialog,
    confirmPass,
    editSimple,
    editBrand,
  },
  setup() {
    const editDialogRef = ref(null)
    const confirmPassRef = ref(null)
    const editSimpleRef = ref(null)
    const editBrandRef = ref(null)

    const state = reactive({
      handleData: {},
      loading: false,
      page: 1,
      size: 10,
      total: 0,
      activeName: 2,
      tableHeight: 0,
      searchForm: {},
      tableData: [],
      chooseList: [],
      statusOptions: [
        {
          value: 1,
          label: '销售中',
        },
        {
          value: 0,
          label: '下架',
        },
      ],
      scOptions: [
        {
          value: 1,
          label: '自动生产',
        },
        {
          value: 2,
          label: '手动生产',
        },
      ],
      typeOptions: [],
      simpleOptions: [],

      slotKey: 'create_time',
      slotValue: 'desc',
    })

    function typeChange(e) {
      state.searchForm.categoryId = null
      if (!e) {
        state.simpleOptions = []
        return
      }
      getSimOptions(e)
    }

    function getSimOptions(typeId) {
      const obj = {
        typeId
      }
      api.goodsCategoryListSimple(obj).then(res => {
        if (res.code == '200') {
          state.simpleOptions = res.data
        } else {
          warningDeal(res.msg)
        }
      }).catch(err => {
        console.log(err)
      })
    }

    function getTypeOptions() {
      api.goodsTypeListSimple().then(res => {
        if (res.code == '200') {
          state.typeOptions = res.data
        } else {
          warningDeal(res.msg)
        }
      }).catch(err => {
        console.log(err)
      })
    }

    function tabChange(e) {
      state.searchForm = {}
      state.tableData = []
      state.page = 1
      getTableData()
    }

    function searchHandle() {
      state.page = 1
      getTableData()
    }

    function restHandle() {
      state.searchForm = {}
      searchHandle()
    }

    function handleCurrentChange(e) {
      state.page = e
      getTableData()
    }

    function handleSizeChange(e) {
      state.size = e
      getTableData()
    }

    function getTableData() {
      switch (state.activeName) {
        case 1:
          getOTable()
          break
        case 2:
          getTTable()
          break
        case 3:
          getThTable()
          break
      }
    }

    function getOTable() {
      state.loading = true
      const obj = {
        page: state.page,
        size: state.size,
        ...state.searchForm,
      }
      api.goodsTypeSearch(obj).then(res => {
        if (res.code == '200') {
          state.tableData = res.data.records
          state.total = res.data.total
        } else {
          warningDeal(res.msg)
        }
        state.loading = false
      }).catch(err => {
        console.log(err)
        state.loading = false
      })
    }

    function getTTable() {
      state.loading = true
      const obj = {
        page: state.page,
        size: state.size,
        ...state.searchForm,
        typeId: state.searchForm.typeId || null,
      }
      if (state.slotKey && state.slotValue) {
        obj.orderBy = `${state.slotKey} ${state.slotValue}`
      } else {
        obj.orderBy = 'create_time desc'
      }
      api.goodsCategorySearch(obj).then(res => {
        if (res.code == '200') {
          state.tableData = res.data.records
          state.total = res.data.total
        } else {
          warningDeal(res.msg)
        }
        state.loading = false
      }).catch(err => {
        console.log(err)
        state.loading = false
      })
    }

    function getThTable() {
      state.loading = true
      const obj = {
        page: state.page,
        size: state.size,
        ...state.searchForm,
        typeId: state.searchForm.typeId || null,
      }
      if (state.slotKey && state.slotValue) {
        obj.orderBy = `${state.slotKey} ${state.slotValue}`
      } else {
        obj.orderBy = 'create_time desc'
      }
      api.goodsBrandSearch(obj).then(res => {
        if (res.code == '200') {
          state.tableData = res.data.records
          state.total = res.data.total
        } else {
          warningDeal(res.msg)
        }
        state.loading = false
      }).catch(err => {
        console.log(err)
        state.loading = false
      })
    }

    function editType(data) {
      editDialogRef.value.dialogShow(data)
    }

    function editSimple(data) {
      editSimpleRef.value.dialogShow(data)
    }

    function editBrand(data) {
      editBrandRef.value.dialogShow(data)
    }

    function lookHanlde(i, data) {
      state.handleData = {
        i,
        data,
      }
      let title = ''
      let msg = ''
      switch (i) {
        case 1:
          //上架
          title = '上架提示'
          msg = '是否确定上架该类型？'
          break
        case 2:
          //下架
          title = '下架提示'
          msg = '该类型下架后，则对应的所有商品不能产生新的销售订单'
          break
        case 3:
          //删除
          title = '删除提示'
          msg = '是否确定删除该类型？'
          break
      }
      confirmPassRef.value.dialogShow(title, msg, false)
    }

    function lookHanlde2(i, data) {
      state.handleData = {
        i,
        data,
      }
      let title = ''
      let msg = ''
      switch (i) {
        case 1:
          //上架
          title = '上架提示'
          msg = '是否确定上架该分类？'
          break
        case 2:
          //下架
          title = '下架提示'
          msg = '该分类下架后，则对应的所有商品不能产生新的销售订单'
          break
        case 3:
          //删除
          title = '删除提示'
          msg = '是否确定删除该分类？'
          break
      }
      confirmPassRef.value.dialogShow(title, msg, false)
    }

    function lookHanlde3(i, data) {
      state.handleData = {
        i,
        data,
      }
      let title = ''
      let msg = ''
      switch (i) {
        case 1:
          //上架
          title = '上架提示'
          msg = '是否确定上架该品牌？'
          break
        case 2:
          //下架
          title = '下架提示'
          msg = '该品牌下架后，则对应的所有商品不能产生新的销售订单'
          break
        case 3:
          //删除
          title = '删除提示'
          msg = '是否确定删除该品牌？'
          break
      }
      confirmPassRef.value.dialogShow(title, msg, false)
    }

    function handleClick(i) {
      state.handleData = {
        i,
      }
      let title = ''
      let msg = ''
      switch (i) {
        case 4:
          //上架
          title = '上架提示'
          msg = '是否确定上架选中品牌？'
          break
        case 5:
          //下架
          title = '下架提示'
          msg = '选中品牌下架后，则对应的所有商品不能产生新的销售订单'
          break
        case 6:
          //删除
          title = '删除提示'
          msg = '是否确定删除选中品牌？'
          break
      }
      confirmPassRef.value.dialogShow(title, msg, false)
    }

    function getBrandIds(list) {
      const myArr = []
      list && list.map(item => {
        item.brandId && myArr.push(item.brandId)
      })
      return myArr
    }

    function verification() {
      if (state.activeName == 1) {
        const typeId = state.handleData.data.typeId
        const typeStatus = state.handleData.i == 1 ? 1 : state.handleData.i == 2 ? 0 : 3
        if (typeStatus == 3) {
          deleteType(typeId)
        } else {
          changeState(typeId, typeStatus)
        }
      } else if (state.activeName == 2) {
        const categoryId = state.handleData.data.categoryId
        const categoryStatus = state.handleData.i == 1 ? 1 : state.handleData.i == 2 ? 0 : 3
        if (categoryStatus == 3) {
          deleteType2(categoryId)
        } else {
          changeState2(categoryId, categoryStatus)
        }
      } else if (state.activeName == 3) {
        const index = state.handleData.i
        if (index == 4 || index == 5 || index == 6) {
          const brandIds = getBrandIds(state.chooseList) || []
          const brandStatus = state.handleData.i == 4 ? 1 : state.handleData.i == 5 ? 0 : 3
          if (brandStatus == 3) {
            deleteType3(brandIds)
          } else {
            changeState3(brandIds, brandStatus)
          }
        } else {
          const brandStatus = state.handleData.i == 1 ? 1 : state.handleData.i == 2 ? 0 : 3
          const brandIds = [state.handleData.data.brandId]
          if (brandStatus == 3) {
            deleteType3(brandIds)
          } else {
            changeState3(brandIds, brandStatus)
          }

        }
      } else if (state.activeName == 4 || state.activeName == 5 || state.activeName == 6) {
      }
    }

    function deleteType(typeId) {
      const obj = {
        typeId
      }
      api.goodsTypeDelete(obj).then(res => {
        if (res.code == '200') {
          getTableData()
        } else {
          warningDeal(res.msg)
        }
      }).catch(err => {
        console.log(err)
      })
    }

    function deleteType2(categoryId) {
      const obj = {
        categoryId
      }
      api.goodsCategoryDelete(obj).then(res => {
        if (res.code == '200') {
          getTableData()
        } else {
          warningDeal(res.msg)
        }
      }).catch(err => {
        console.log(err)
      })
    }

    function deleteType3(brandIds) {
      const obj = {
        brandIds
      }
      api.goodsBrandDelete(obj).then(res => {
        if (res.code == '200') {
          getTableData()
        } else {
          warningDeal(res.msg)
        }
      }).catch(err => {
        console.log(err)
      })
    }

    function changeState(typeId, typeStatus) {
      const obj = {
        typeId,
        typeStatus,
      }
      api.goodsTypeModifyStatus(obj).then(res => {
        if (res.code == '200') {
          getTableData()
        } else {
          warningDeal(res.msg)
        }
      }).catch(err => {
        console.log(err)
      })
    }

    function changeState2(categoryId, categoryStatus) {
      const obj = {
        categoryId,
        categoryStatus,
      }
      api.goodsCategoryModifyStatus(obj).then(res => {
        if (res.code == '200') {
          getTableData()
        } else {
          warningDeal(res.msg)
        }
      }).catch(err => {
        console.log(err)
      })
    }

    function changeState3(brandIds, brandStatus) {
      const obj = {
        brandIds,
        brandStatus,
      }
      api.goodsBrandModifyStatus(obj).then(res => {
        if (res.code == '200') {
          getTableData()
        } else {
          warningDeal(res.msg)
        }
      }).catch(err => {
        console.log(err)
      })
    }

    function handleSelectionChange(e) {
      state.chooseList = e
    }

    function tableSortChange(e) {
      state.slotKey = ((e.prop) ? ((e.prop == 'showPower') ? 'show_power' : (e.prop == 'createTime') ? 'create_time' : null) : null)
      state.slotValue = ((e.order) ? ((e.order == 'descending') ? 'desc' : (e.order == 'ascending') ? 'asc' : null) : null)
      getTableData()
    }

    onMounted(() => {
      let winHeight = getWindowWidthAndHeight()
      state.tableHeight = winHeight.windowHeight - 180
      getTableData()
      getTypeOptions()
    })

    return {
      ...toRefs(state),
      editDialogRef,
      confirmPassRef,
      editSimpleRef,
      editBrandRef,
      searchHandle,
      tabChange,
      handleCurrentChange,
      handleSizeChange,
      getTableData,
      editType,
      getDateTime,
      lookHanlde,
      verification,
      editSimple,
      lookHanlde2,
      typeChange,
      restHandle,
      handleSelectionChange,
      editBrand,
      lookHanlde3,
      handleClick,
      tableSortChange,
    }
  }
}
</script>

<style lang="scss" scoped>
.box-all {
  width: 100%;
  height: 100%;
  overflow: hidden;
  box-sizing: border-box;
  padding: 0 20px;
  .tab-box {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    .tab-box-title {
      display: flex;
      align-items: center;
      > span {
        font-size: 16px;
        font-weight: bold;
      }
    }
    .search-box {
      display: flex;
      align-items: center;
      gap: 20px;
      margin-top: 20px;
      > div {
        font-size: 14px;
        display: flex;
        align-items: center;
        gap: 10px;
        > span {
          flex-shrink: 0;
        }
      }
    }
  }
}
.table-box {
  margin-top: 20px;
  .table-footer {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
  }
  .table-footer2 {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
}
.table-handle-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.state0 {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #ff3939;
}
.state1 {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #03b615;
}
</style>